package com.tuling.designpattern.mediator;

/**
 * @author 林瑞涛
 * @desc   测试类
 * @date 2021年08月10日 19:44
 */
public class Client {
    public static void main(String[] args) {
        Mediator mediator = new ConcreteMediator();
        Colleague c1, c2;
        c1 = new ConcreteColleague1();
        c2 = new ConcreteColleague2();
        mediator.register(c1);
        mediator.register(c2);
        c1.send();
        c2.receive();
        System.out.println("--------------");
        c2.send();
        c1.receive();
    }
}
